<template>
  <div>
    <van-field
      v-model="formItem.value"
      :type="formItem.type"
      :name="formItem.name"
      :label="formItem.label"
      :placeholder="formItem.placeholder"
      :rules="formItem.rules"
      input-align="right"
      :label-width="160"
      :readonly="typeno"
    />
  </div>
</template>

<script>
/**
 * 基础input框
 *
 */
export default {
  data(){
    return{
      typeno:false
    }
  },
  created() {
    let type = Number(this.$route.query.type);
    if (type == 0 || type == -1) {
      this.typeno = false
    }else{
      this.typeno = true
    }
  },
  props: {
    formItem: {
      type: Object,
      default: {
        value:"",
        type:"",
        name:"",
        label:"",
        placeholder:"",
        inputAlign:'left',
        rules:[]
      }
    }
  }
};
</script>
<style lang="less" scoped>
.hide-box{
display: none;
}
</style>
